import request from '@/utils/request';
import { objectToFormData} from '@/utils/form'


export function listForClassify(data: any) {
  return request({
    url: '/api/v1/product/classify/list',
    method: 'post',
    data: data
  });
}


export function selectTree(data: any) {
  return request({
    url: '/api/v1/product/classify/selectTree',
    method: 'post',
    data: data
  });
}

export function saveForTree(data: any) {
  return request({
    url: '/api/v1/product/classify/save',
    method: 'post',
    data: data
  });
}

export function deleteForTree(data: any) {
  return request({
    url: '/api/v1/product/classify/delete',
    method: 'post',
    data: data
  });
}


export function saveForProduct(data: any) {
  return request({
    url: '/api/v1/product/save',
    method: 'post',
	headers: { "Content-Type": "multipart/form-data" },
    data: objectToFormData(data)
  });
}

export function listForProduct(data: any) {
  return request({
    url: '/api/v1/product/pages',
    method: 'get',
    params: data
  });
}

export function deleteForProduct(data: any) {
  return request({
    url: '/api/v1/product/delete',
    method: 'post',
    data: data
  });
}



export function saveForProductFun(data: any) {
  return request({
    url: '/api/v1/product/fun/save',
    method: 'post',
	headers: { "Content-Type": "multipart/form-data" },
    data: objectToFormData(data)
  });
}

export function listForProductFun(data: any) {
  return request({
    url: '/api/v1/product/fun/list',
    method: 'post',
    data: data
  });
}

export function deleteForProductFun(data: any) {
  return request({
    url: '/api/v1/product/fun/delete',
    method: 'post',
    data: data
  });
}






